﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using EB.Generics;
/// <summary>
/// Summary description for PopulateMenuByUser
/// </summary>

namespace Menu
{
    public class PopulateMenuByUser
    {
        EB.Generics.Generics commonClass = new EB.Generics.Generics();

        public PopulateMenuByUser()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public DataSet PopulateParentMenu()
        {
            string query = string.Empty;
            query = "SELECT   ParentID,  MenuID, Text  FROM         Menu where ParentID is null";
            DataSet menu = commonClass.ExecuteQuery(query);
            return menu;
        }
        public DataSet PopulateSubMenu(int parentMenuID)
        {
            string query = string.Empty;
            query = "SELECT     MenuID, Text FROM         Menu where ParentID='" + parentMenuID + "'";
            DataSet menu = commonClass.ExecuteQuery(query);
            return menu;

        }
    }
}